package com.jtjrenren.android.taxi.passenger.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by wdl on 2016/1/25.
 */
public class DbHelper extends SQLiteOpenHelper {
    private static final String DB_NAME = "rrcx";
    private static final int DB_VERSION = 1;

    public DbHelper(Context context) {
        super(context, DB_NAME, null, DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String addressSql = "create table address(user_id varchar(30),id integer primary key autoincrement,name varchar(50),addr varchar(60),lati varchar(20),loni varchar(20),type integer,count integer default 0)";
        db.execSQL(addressSql);
        String userSql = "create table user(id varchar(50) primary key,name varchar(30),sex integer,age integer,phone varchar(20),addr varchar(20),wallect_balance varchar(20),jindou integer)";
        db.execSQL(userSql);
        String orderSql="create table orderm(user_id varchar(30),serno varchar(20) primary key,order_status integer)";
        db.execSQL(orderSql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
